Skip to content

feat: add mailbox management tools (list, create, move)#109

Open
trofimovm wants to merge 2 commits intoai-zerolab:mainfrom
trofimovm:feature/mailbox-management
Open

feat: add mailbox management tools (list, create, move)#109
trofimovm wants to merge 2 commits intoai-zerolab:mainfrom
trofimovm:feature/mailbox-management

Conversation

@trofimovm
Copy link

Summary

Adds three new MCP tools for mailbox/folder management:

  • list_mailboxes - List all available mailboxes/folders for an email account
  • create_mailbox - Create a new mailbox/folder
  • move_emails - Move one or more emails to another mailbox/folder

Changes

  • Added abstract methods to EmailHandler interface
  • Implemented methods in EmailClient and ClassicEmailHandler
  • Added MCP tool definitions in app.py
  • Uses COPY + DELETE + EXPUNGE pattern for move operations (IMAP compatibility)
  • Proper mailbox name quoting via existing _quote_mailbox() for RFC 3501 compliance

Use Cases

  • Organize emails into custom folders
  • Archive old emails
  • Implement email workflow automation

Test Plan

  • Tested list_mailboxes with Yandex Mail
  • Tested create_mailbox creates folder successfully
  • Tested move_emails moves messages and removes from source
  • Tested with mailbox names containing special characters

trofimovm and others added 2 commits January 22, 2026 17:53
Add three new MCP tools for mailbox/folder management:
- list_mailboxes: List all available mailboxes/folders
- create_mailbox: Create a new mailbox/folder
- move_emails: Move emails between mailboxes

Implementation details:
- Added abstract methods to EmailHandler interface
- Implemented methods in EmailClient and ClassicEmailHandler
- Uses COPY + DELETE + EXPUNGE for move (IMAP compatibility)
- Proper mailbox name quoting via _quote_mailbox() for RFC 3501
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 17.64706% with 84 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mcp_email_server/emails/classic.py 7.7% 71 Missing ⚠️
mcp_email_server/app.py 31.5% 13 Missing ⚠️

📢 Thoughts on this report? Let us know!

perelin added a commit to perelin/mcp-email-server that referenced this pull request Feb 1, 2026
Cherry-picked from upstream PR ai-zerolab#109. Adds move_emails,
list_mailboxes, and create_mailbox tools for folder management.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant